<?php include template("header");?>
<link href="../../static/css/index.css" rel="stylesheet" type="text/css" />
<div id="bdw" class="bdw">
<div id="bd" class="cf">

<?php if($team['close_time']){?>
<div id="sysmsg-tip" class="sysmsg-tip-deal-close"><div class="sysmsg-tip-top"></div><div class="sysmsg-tip-content"><div class="deal-close"><div class="focus">A oferta está fechada.</div><div id="tip-deal-subscribe-body" class="body"><form id="tip-deal-subscribe-form" method="post" action="/subscribe.php" class="validator"><table><tr>
              <td>Para receber novas ofertas, cadastre seu e-mail:&nbsp;</td><td><input type="text" name="email" class="f-text" value="" require="true" datatype="email" /></td><td>&nbsp;<input class="commit" type="submit" value="" /></td></tr></table></form></div></div><span id="sysmsg-tip-close" class="sysmsg-tip-close">Fechar</span></div><div class="sysmsg-tip-bottom"></div></div>
<?php }?>

<?php if($order){?>
<div id="sysmsg-tip" ><div class="sysmsg-tip-top"></div><div class="sysmsg-tip-content">
  <h3>Obrigado pela compra!</h3>
    Recebemos seu pedido! <br>
    Uma mensagem com detalhes desta transação foi enviada para seu endereço de email. <br>
    Caso  tenha ocorrido algum erro no pagamento, <a href="/<?php echo $city['ename']; ?>/seu_pedido/<?php echo $order['id']; ?>">verifique seu pedido e efetue o pagamento</a>
    <span id="sysmsg-tip-close" class="sysmsg-tip-close">Fechar</span></div><div class="sysmsg-tip-bottom"></div></div><div id="deal-default">
<?php }?>
	<div id="deal-default">
		<?php include template("block_team_share");?>
		<div id="content">
			<div id="deal-intro" class="cf">
            <h1><?php if($team['close_time']==0){?><a class="deal-today-link" href="/<?php echo $city['ename']; ?>/oferta_do_dia">Baladas Hoje: </a><?php }?><?php echo $team['title']; ?></h1>
                <div class="main">
                  <div class="deal-buy">
                        <div class="deal-price-tag"></div>
					<?php if(($team['state']=='soldout')){?>
                        <p class="deal-price"><strong><?php echo $currency; ?><?php echo moneyit3($team['team_price']); ?></strong><span class="deal-price-soldout"></span></p>
					<?php } else if($team['close_time']) { ?>
                    <p class="deal-price"><strong></strong><span class="deal-price-expire"></span></p>
					<?php } else { ?>
                <p class="deal-price"><span><a <?php echo $team['begin_time']<time()?'href="/'.$city['ename'].'/comprar/'.$team['id'].'"':''; ?>></span><img src="/static/css/i/compre-agora-1.png" alt="" width="221" height="62" hspace="5" vspace="10" /></a></p>
                        <?php }?>
                  </div>
      <table border="1" cellspacing="0" class="deal-discount">
                        <tr>
                          <p class="deal-valor"><th colspan="2"><p class="deal-valor">Valor: <?php echo $currency; ?><?php echo moneyit3($team['team_price']); ?></p></th></p>
                        </tr>
                        <tr>
                            <th>Desconto<br />
                            <span class="deal-porcentagem"><?php echo moneyit2((100*($team['market_price'] - $team['team_price'])/$team['market_price'])); ?>%</span></th>
                            <th>Você Economiza<br />
                            <span class="deal-economiza"><?php echo $currency; ?><?php echo moneyit3($discount_price); ?></span></th>
                        </tr>
                  </table>
					<?php if($team['close_time']){?>
<div class="deal-box deal-timeleft-off deal-off" id="deal-timeleft" curtime="<?php echo $now; ?>000" diff="<?php echo $diff_time; ?>000">
						<h3>Oferta expirou em</h3>
						<div class="limitdate-end"><p class="deal-buy-ended">
						 <li><span><?php echo date('d-m-Y', $team['close_time']); ?></span></li>
                    </div>
				  </div>
					<?php } else { ?>
                    <div class="deal-box deal-timeleft deal-on" id="deal-timeleft" curtime="<?php echo $now; ?>000" diff="<?php echo $diff_time; ?>000">
						      <h3>Tempo restante</h3>
					                        <div class="contador">
						           <div class="limitdate"><ul id="counter">
							<?php if($left_day>0){?>
								<li><span><?php echo $left_hour; ?></span></li>
					            <li><span><?php echo $left_minute; ?></span></li>
					            <li><span><?php echo $left_time; ?></span></li>
					                               <?php }?>
					                           </ul>
					                        </div>
					                      </div>
             </div>
					<?php }?>

				<?php if($team['close_time']==0){?>
					<?php if($team['state']=='none'){?>
					<div class="deal-box deal-status" id="deal-status">
						<p class="deal-buy-tip-top"><strong><?php echo $team['now_number']; ?></strong> já compraram</p>
						<div class="progress-pointer" style="padding-left:<?php echo $bar_size-$bar_offset; ?>px;"><span></span></div>
						<div class="progress-bar"><div class="progress-left" style="width:<?php echo $bar_size-$bar_offset; ?>px;"></div><div class="progress-right "></div></div>
						<div class="cf"><div class="min">0</div><div class="max"><?php echo $team['min_number']; ?></div></div>
						<p class="deal-buy-tip-btm">Faltam <strong><?php echo $team['min_number']-$team['now_number']; ?></strong> para ativar a oferta! </p>
					</div>
					<?php } else { ?>
					<div class="deal-box deal-status deal-status-open" id="deal-status">
						<p class="deal-buy-tip-top"><strong><?php echo $team['now_number']; ?></strong> baladeiros já compraram</p>
					<?php if($team['max_number']&&$team['max_number']>$team['now_number']){?>
						<p class="deal-buy-tip-btm">Ainda disponivel: <strong><?php echo $team['max_number']-$team['now_number']; ?></strong>, compre agora</p>
					<?php }?>
						<p class="deal-buy-on" style="line-height:200%;"><img src="/static/css/i/deal-buy-succ.gif"/> Balada está ativa! <?php if($team['max_number']>$team['now_number']||$team['max_number']==0){?><br/>
<span class="deal-buy-tip-btm">Seu cupom pode ser liberado para uso no mesmo dia, confira as regras na oferta.</span>Minimo para ativar esta oferta é:<strong><?php echo $team['min_number']; ?></strong> baladeiros</p>
					<?php }?>
					</div>
					<?php }?>
				<?php } else { ?>
					<div class="deal-box deal-status deal-status-<?php echo $team['state']; ?>" id="deal-status"><div class="deal-buy-<?php echo $team['state']; ?>"></div>
					<p class="deal-buy-tip-total">total de <strong><?php echo $team['now_number']; ?></strong> baladeiros</p></div>
				<?php }?>
				</div>
                <div class="side">
                    <div class="deal-buy-cover-img" id="team_images">
					<?php if($team['image1']||$team['image2']){?>
						<div class="mid">
							<ul>
								<li class="first"><img src="<?php echo team_image($team['image']); ?>"/></li>
							<?php if($team['image1']){?>
								<li><img src="<?php echo team_image($team['image1']); ?>"/></li>
							<?php }?>
							<?php if($team['image2']){?>
								<li><img src="<?php echo team_image($team['image2']); ?>"/></li>
							<?php }?>
							</ul>
							<div id="img_list">
								<a ref="1" class="active">1</a>
							<?php $imageindex=1;; ?>
							<?php if($team['image1']){?>
								<a ref="<?php echo ++$imageindex; ?>" ><?php echo $imageindex; ?></a>
							<?php }?>
							<?php if($team['image2']){?>
								<a ref="<?php echo ++$imageindex; ?>" ><?php echo $imageindex; ?></a>
							<?php }?>
							</div>
						</div>
						<?php } else { ?>
							<img src="<?php echo team_image($team['image']); ?>" width="440" height="280" />
						<?php }?>
					</div>
				<?php if(strip_tags($team['summary'])!=$team['summary']){?><?php echo $team['summary']; ?><?php } else { ?><div class="digest"><br /><?php echo nl2br(strip_tags($team['summary'])); ?></div><?php }?>
                </div>
            </div>
            <div id="deal-stuff" class="cf">
                <div class="clear box <?php echo ($partner&&!option_yes('teamwhole'))?'box-split':''; ?>">
                    <div class="box-top"></div>
                    <div class="box-content cf">
                        <div class="main" id="team_main_side">
						<?php if(trim(strip_tags($team['detail']))){?>
                            <h2 id="detail">Detalhes</h2>
							<div class="blk detail"><?php echo $team['detail']; ?></div>
						<?php }?>
						<?php if(trim(strip_tags($team['notice']))){?>
							<h2 id="detailit">Dicas</h2>
							<div class="blk cf"><?php echo $team['notice']; ?></div>
						<?php }?>
						<?php if(trim(strip_tags($team['userreview']))){?>
							<h2 id="userreview">Recomendações</h2>
							<div class="blk review"><?php echo userreview($team['userreview']); ?></div>
						<?php }?>
						<?php if(trim(strip_tags($team['systemreview']))){?>
							<h2 id="systemreview"><?php echo $INI['system']['abbreviation']; ?> disse</h2>
							<div class="blk review"><?php echo $team['systemreview']; ?></div>
						<?php }?>
						</div>

                        <div class="side" id="team_partner_side_<?php echo (!option_yes('teamwhole')&&abs(intval($partner['id'])))?1:0; ?>">
                            <div id="side-Business">
								<h2><?php echo $partner['title']; ?></h2>
								<div style="margin-top:10px;"><?php echo $partner['location']; ?></div>
								<div style="margin-top:10px;"><a href="<?php echo $partner['homepage']; ?>" target="_blank"><?php echo domainit($partner['homepage']); ?></a></div>
								<?php include template("block_block_partnermap");?>
							</div>
						</div>

                        <div class="clear"></div>
                    </div>
                    <div class="box-bottom"></div>
                </div>
            </div>
    </div>
    <div id="sidebar">

		<?php include template("block_side_invite");?>
		<?php include template("block_side_bulletin");?>
		<?php include template("block_side_flv");?>
		<?php include template("block_side_others_seconds");?>
		<?php include template("block_side_ask");?>
		<?php include template("block_side_others");?>
		<?php include template("block_side_vote");?>
		<?php include template("block_side_business");?>
		<?php include template("block_side_subscribe");?>
	</div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<?php include template("footer");?>
